package net.sk.china.platform.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.sk.china.platform.model.SensitiveLog;
import net.sk.china.platform.service.SensitiveLogService;
import net.sk.china.common.request.PageParamRequest;
import net.sk.china.common.response.CommonPage;
import net.sk.china.common.response.CommonResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/3 20:50
 * +----------------------------------------------------------------------
 */

@RestController
@RequestMapping(value = "log/sensitive/")
@Api(tags = "操作日志")
public class SensitiveLogController {

    private final SensitiveLogService sensitiveLogService;

    public SensitiveLogController(SensitiveLogService sensitiveLogService) {
        this.sensitiveLogService = sensitiveLogService;
    }

    @PreAuthorize("hasAuthority('admin:log:sensitive:list')")
    @ApiOperation(value = "列表")
    @RequestMapping(value = "list", method = RequestMethod.GET)
    public CommonResult<CommonPage<SensitiveLog>> getList(@ModelAttribute PageParamRequest pageParamRequest) {
        return CommonResult.success(CommonPage.restPage(sensitiveLogService.getList(pageParamRequest)));
    }
}
